package com.he.ymw.controller;

import com.he.ymw.pojo.Product;
import com.he.ymw.service.ProductService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/**
 * 分页查询
 */
@Controller
public class ProductsController {

    @Resource
    ProductService productService;

    @RequestMapping("/findProduct")
    @ResponseBody
    public String findProduct(String name,String page) {

        List<Product> products = productService.findProducts("香",1);
        for (Product product : products) {
            System.out.println(product);
        }
        return products.toString();
    }




}
